<extend name="work/base" />
<block name="content">

    <form class="layui-form inline-form">
        <div class="pull-left">


        </div>
        <div class="pull-right">
            <div class="layui-inline">
                <button class="layui-btn layui-btn-normal layui-btn-sm ajax-form" data-url="{:url('add')}"><i class="layui-icon">&#xe61f;</i> 新增</button>
            </div>
        </div>
    </form>
    <table class="layui-table text-center" id="list" lay-filter="list" list-url="{:url('lists')}" edit-url="{:url('edit')}" assigned-url="{:url('editcategory')}" del-url="{:url('delete')}"></table>

</block>

<block name="script">
    <script type="text/html" id="barDemo">
        <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="delete">删除</a>
    </script>

    <script type="text/html" id="viewimg">
       <img class="img" src="{{d.img}}">
           </script>
    <script type="text/javascript">
        layui.use([ 'element', 'table'], function(){
            var table = layui.table;
            table.render({
                elem: '#list'
                ,url:"{:Url('lists')}"
                ,toolbar: '<div></div>'
                ,page:true
                ,loading:true
                ,title:'品牌表'
                ,limit:20
                ,defaultToolbar: ['filter', 'print', 'exports']
                ,cols: [[
                    {field:'keyword',  width:200, title: '关键字',edit:'text'}
                    ,{field:'title', title: '推送图文消息内容'}
                    ,{fixed: 'right', width:150,title:'操作',  toolbar:'#barDemo'}
                ]]
            });
        });
    </script>
</block>
